﻿<ResourceDictionary xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
                    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
                    xmlns:s="clr-namespace:MockupDesigner.AppItems"
                    xmlns:c="clr-namespace:MockupDesigner.Items"
                    xmlns:SketchControls="clr-namespace:Microsoft.Expression.Prototyping.SketchControls;assembly=Microsoft.Expression.Prototyping.SketchControls"
                    xmlns:ps="clr-namespace:Microsoft.Expression.Prototyping.SketchControls;assembly=Microsoft.Expression.Prototyping.SketchControls" 
                    xmlns:wpfToolkit="http://schemas.microsoft.com/wpf/2008/toolkit"
                    xmlns:ac="clr-namespace:MockupDesigner.AdditionalControls">

    <!-- Control Templates For Items-->
    <ControlTemplate x:Key="GroupBoxItemTemplate" TargetType="{x:Type c:GroupBoxItem}">
        <GroupBox 
            Header="{Binding Path=Text, RelativeSource={RelativeSource AncestorType={x:Type c:GroupBoxItem}}}" 
            Style="{DynamicResource GroupBoxStyle}"/>
    </ControlTemplate>
    <ControlTemplate x:Key="TabControlItemTemplate" TargetType="{x:Type c:TabControlItem}">
        <TabControl 
            ItemsSource="{Binding Path=ItemsSource, RelativeSource={RelativeSource AncestorType={x:Type c:TabControlItem}}}"
            Style="{DynamicResource TabControl-Sketch}" >
        </TabControl>
    </ControlTemplate>

    <ControlTemplate x:Key="WebPageItemTemplate" TargetType="{x:Type c:WebPageItem}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="50" />
                <RowDefinition MinHeight="20"/>
            </Grid.RowDefinitions>
            <Label Grid.Row="0" Style="{DynamicResource GridLabelStyle}" />
            <Grid Grid.Row="0">
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition />
                    <ColumnDefinition Width="50"/>
                </Grid.ColumnDefinitions>
                <StackPanel Grid.Column="0" Orientation="Horizontal" Margin="5,5,0,0" >
                    <!-- Previous Button -->
                    <Path Stroke="#606060" StrokeThickness="2" Margin="2,15,2,0">
                        <Path.Data>
                            <PathGeometry>
                                <PathGeometry.Figures>
                                    <PathFigureCollection>
                                        <PathFigure IsClosed="True" StartPoint="0,10">
                                            <PathFigure.Segments>
                                                <PathSegmentCollection>
                                                    <LineSegment Point="10,0" />
                                                    <LineSegment Point="10,5" />
                                                    <LineSegment Point="20,5" />
                                                    <LineSegment Point="20,15" />
                                                    <LineSegment Point="10,15" />
                                                    <LineSegment Point="10,20" />
                                                </PathSegmentCollection>
                                            </PathFigure.Segments>
                                        </PathFigure>
                                    </PathFigureCollection>
                                </PathGeometry.Figures>
                            </PathGeometry>
                        </Path.Data>
                    </Path>
                    <!-- Next Button -->
                    <Path Stroke="#606060" StrokeThickness="2" Margin="2,15,2,0">
                        <Path.Data>
                            <PathGeometry>
                                <PathGeometry.Figures>
                                    <PathFigureCollection>
                                        <PathFigure IsClosed="True" StartPoint="20,10">
                                            <PathFigure.Segments>
                                                <PathSegmentCollection>
                                                    <LineSegment Point="10,0" />
                                                    <LineSegment Point="10,5" />
                                                    <LineSegment Point="0,5" />
                                                    <LineSegment Point="0,15" />
                                                    <LineSegment Point="10,15" />
                                                    <LineSegment Point="10,20" />
                                                </PathSegmentCollection>
                                            </PathFigure.Segments>
                                        </PathFigure>
                                    </PathFigureCollection>
                                </PathGeometry.Figures>
                            </PathGeometry>
                        </Path.Data>
                    </Path>
                    <!-- Home Button -->
                    <Path Stroke="#606060" StrokeThickness="2" Margin="2,7,2,0">
                        <Path.Data>
                            <PathGeometry>
                                <PathGeometry.Figures>
                                    <PathFigureCollection>
                                        <PathFigure IsClosed="True" StartPoint="15,0">
                                            <PathFigure.Segments>
                                                <PathSegmentCollection>
                                                    <LineSegment Point="0,25" />
                                                    <LineSegment Point="5,25" />
                                                    <LineSegment Point="5,30" />
                                                    <LineSegment Point="25,30" />
                                                    <LineSegment Point="25,25" />
                                                    <LineSegment Point="30,25" />
                                                </PathSegmentCollection>
                                            </PathFigure.Segments>
                                        </PathFigure>
                                    </PathFigureCollection>
                                </PathGeometry.Figures>
                            </PathGeometry>
                        </Path.Data>
                    </Path>
                </StackPanel>
                <StackPanel Grid.Column="1" Orientation="Vertical">
                    <Label Content="{Binding Path=Title, RelativeSource={RelativeSource AncestorType={x:Type c:WebPageItem}}}" Style="{DynamicResource SimpleLabelStyle}" HorizontalAlignment="Center" />
                    <TextBox Text="{Binding Path=Address, RelativeSource={RelativeSource AncestorType={x:Type c:WebPageItem}}}" Style="{DynamicResource TextBox-Sketch}" Height="20" />
                </StackPanel>
                <Label Grid.Column="2" Content="Go" Style="{DynamicResource ButtonStyle}" Height="20" Margin="5,0,5,7" VerticalAlignment="Bottom" />
            </Grid>
            <!-- Body of the window -->
            <Label Grid.Row="1" Style="{DynamicResource GridLabelStyle}" />
        </Grid>
    </ControlTemplate>

    <ControlTemplate x:Key="WindowItemTemplate" TargetType="{x:Type c:WindowItem}">
        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="50" />
                <RowDefinition MinHeight="20"/>
            </Grid.RowDefinitions>
            <Label Grid.Row="0" Style="{DynamicResource GridLabelStyle}" />
            <!--<Grid Grid.Row="0">-->
            <!--<Grid.ColumnDefinitions>
                    <ColumnDefinition Width="100"/>
                    <ColumnDefinition />
                    <ColumnDefinition Width="50"/>
                </Grid.ColumnDefinitions>-->
            <StackPanel Grid.Row="0" Orientation="Vertical">
                <Label Content="{Binding Path=Text, RelativeSource={RelativeSource AncestorType={x:Type c:WindowItem}}}" Style="{DynamicResource SimpleLabelStyle}" HorizontalAlignment="Center" />
                <StackPanel Orientation="Horizontal">
                    <Label Content="File" Style="{DynamicResource SimpleLabelStyle}" />
                    <Label Content="Edit" Style="{DynamicResource SimpleLabelStyle}" />
                    <Label Content="View" Style="{DynamicResource SimpleLabelStyle}" />
                    <Label Content="Help" Style="{DynamicResource SimpleLabelStyle}" />
                </StackPanel>
            </StackPanel>
            <!--</Grid>-->
            <!-- Body of the window -->
            <Label Grid.Row="1" Style="{DynamicResource GridLabelStyle}" />
        </Grid>
    </ControlTemplate>

    <!-- ToolBox -->
    <s:Toolbox x:Key="ContainersToolbox">
        <c:GroupBoxItem ToolTip="GroupBox" IsHitTestVisible="False" 
            Height="50"
            Text="GroupBox"
            Template="{DynamicResource GroupBoxItemTemplate}"/>
        <c:TabControlItem ToolTip="TabControl" IsHitTestVisible="False" 
            Width="110"
            Template="{DynamicResource TabControlItemTemplate}"/>
        <c:WebPageItem ToolTip="WebPage" IsHitTestVisible="False" 
            Height="50" Width="100" 
            Title="Title"
            Address="http://www.evaluant.com"
            Template="{DynamicResource WebPageItemTemplate}" />
        <c:WindowItem ToolTip="Window" IsHitTestVisible="False" 
            Height="50" Width="100" 
            Text="Title"
            Template="{DynamicResource WindowItemTemplate}" />
    </s:Toolbox>
</ResourceDictionary>